package com.glela.platform.model.request;

public class RequestPageBaseModel extends RequestBaseModel {

	private Integer pageSize;
	private Integer pageNum;

	public Integer getPageSize() {
		if (pageSize == null) {
			pageSize = 10;
		} else if (pageSize > 50) {
			pageSize = 10;
		}
		return pageSize;
	}

	public void setPageSize(Integer pageSize) {
		this.pageSize = pageSize;
	}

	public Integer getPageNum() {
		if (pageNum == null) {
			pageNum = 1;
		} else if (pageNum == 0) {
			pageNum = 1;
		}
		return pageNum;
	}

	public void setPageNum(Integer pageNum) {
		this.pageNum = pageNum;
	}

	public int getStartIndex() {
		return (getPageNum() - 1) * getPageSize();
	}

}
